#include "HufArc.h"

int WriteToArc_arc (FILE* arc,FILE * fileToRead, fileHead* fileHd)
{
	unsigned int CheckSum = 0;
	unsigned long long int count = 0;
	char * buf = (char*) calloc (SIZE_BUF,sizeof(char));
	int rc = 0;
	unsigned int sizeFileSz = 0;
	if (!buf)
		cl_exit (WRITE_TO_ARC_ARC,MEMORY_ERR,arc,fileToRead,fileHd);
	intWrite (arc,(unsigned long long int) fileHd->sizeName,NAME_LEN,&CheckSum);
	strWrite (arc,fileHd->fileName,fileHd->sizeName,&CheckSum);
	intWrite (arc, fileHd -> mtime, SIZE_T_8, &CheckSum);
	fileToRead = arc_file (fileHd,fileToRead);
}